package com.ruoyi.bizsys.vo;

import com.ruoyi.bizsys.domain.IncreasedLimitLog;
import com.ruoyi.common.constant.Constants;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author mac
 */
public class IncreasedLimitLogVo extends IncreasedLimitLog {

    /**
     * 初始化提额
     *
     * @param custNo
     * @param creditLine
     * @param createTime
     */
    public IncreasedLimitLogVo(String custNo, BigDecimal creditLine, Date createTime) {
        this.setCustNo(custNo);
        this.setIncreasedAmt(creditLine);
        this.setCurrentCreditLine(creditLine);
        this.setIncreasedCreditLine(creditLine);
        this.setIncreasedReason("初始化提额");
        this.setAdjustType(com.ruoyi.common.constant.Constants.RaiseLimit.ADJUST_TYPE_INIT);
        this.setCreateTime(createTime);
        this.setUpdateTime(new Date());
    }


    /**
     * @param custNo
     * @param crrentCreditLine
     * @param increasedAmt
     */
    public IncreasedLimitLogVo(String custNo, BigDecimal crrentCreditLine, BigDecimal increasedAmt, String adjustType) {
        this.setCustNo(custNo);
        this.setIncreasedAmt(increasedAmt);
        this.setCurrentCreditLine(crrentCreditLine);
        this.setIncreasedCreditLine(increasedAmt.add(crrentCreditLine));
        String reason = Constants.RaiseLimit.ADJUST_TYPE_REPLENISH_INFO.equals(adjustType) ? "补充信息提额" :
                Constants.RaiseLimit.ADJUST_TYPE_BANK_CARD.equals(adjustType) ? "银行卡提额" : "自动化提额";
        this.setIncreasedReason(reason);
        this.setAdjustType(adjustType);
        this.setCreateTime(new Date());
        this.setUpdateTime(new Date());
    }


}
